<include file="Common:layout" />
<style type="text/css">
    .out_put_btn {
        display: block;
        font-size: 12px;
        color: #0ba4da;
        background-color: #FFFFFF;
        padding: 4px 7px;
        border: solid 1px #3aa8cf;
        border-radius: 4px;
        cursor: pointer;
    }
    .out_put_btn:hover {
        background-color: #e6fcff;
    }
</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>发货单列表</h3>
            </div>
        </div>
    </div>

    <bDi class="flexigrid">
        <form action="" class="navbar-form form-inline" method="get">
            <div class="mDiv">
                <input type="hidden" name="m" value="admin"/>
                <input type="hidden" name="c" value="order"/>
                <input type="hidden" name="a" value="send_order"/>
                <div class="sDiv">
                    <div class="sDiv2">
                        <input type="text" size="20" name="user_name" placeholder="收货人用户名或手机" value="{$u_name}">
                        <input type="text" name="start_time" id="start_time" placeholder="下单开始时间" value="{$start_time}">
                        <input type="text" name="end_time" id="end_time" placeholder="下单结束时间" value="{$end_time}">
                        <input type="text" name="order_id" placeholder="填写订单编号" value="{$orderId}">
                        <input type="text" size="14" id="shop_name" name="shop_name" placeholder="填写店铺名" value="{$shop_name}">
                        <select  class="select" name="shop_id" id="shop_id">
                            <option value="">请选择店铺名</option>
                        </select>
                        <input type="submit" class="btn" value="搜索" name="btn"/>
                    </div>
                </div>
            </div>
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0">
                        <thead>
                        <tr>
                            <th align="center" abbr="article_title" axis="col6">
                                <div style="text-align: center; width:50px;" class="">ID</div>
                            </th>
                            <th align="center" abbr="article_title" axis="col3" class="">
                                <div style="text-align: center; width: 100px;" class="">订单编号</div>
                            </th>
                            <th align="center" abbr="ac_id" axis="col4" class="">
                                <div style="text-align: center; width: 150px;" class="">下单时间</div>
                            </th>
                            <th align="center" abbr="ac_id" axis="col4" class="">
                                <div style="text-align: center; width: 60px;" class="">收货人</div>
                            </th>
                            <th align="center" abbr="article_show" axis="col5" class="">
                                <div style="text-align: center; width: 100px;" class="">联系电话</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 70px;" class="">所选物流</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 80px;" class="">物流费用</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 70px;" class="">支付方式</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 80px;" class="">店铺名称</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 60px;" class="">订单总价</div>
                            </th>
                            <th align="center" abbr="article_time" axis="col6" class="">
                                <div style="text-align: center; width: 150px;" class="">发货时间</div>
                            </th>
                            <th align="center" abbr="article_title" axis="col6">
                                <div style="text-align: center; width:100px;" class="">操作</div>
                            </th>
                            <th style="width:100%" axis="col7">
                                <div></div>
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="bDiv" style="height: auto;">
                <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                    <table>
                        <tbody>
                        <volist name="orders" id="order" key="k" >
                            <tr>
                                <td align="center" axis="col0">
                                    <div style="width: 50px;text-align: center">{$k}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 100px;">{$order['order_id']}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 150px;">{$order['time']}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 60px;">
                                        {$order['consignee']}
                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 100px;">
                                        {$order['phone']}
                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 70px;">
                                        {$order['send_type']}
                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 80px;">
                                        {$order['freight_price']}元
                                    </div>
                                </td>
                                <td align="center">
                                    <div style="text-align: center; width: 70px;">
                                        {$order['pay_type']}元
                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 80px;">
                                        {$order['shop_name']}
                                    </div>
                                </td>
                                <td align="center">
                                <div style="text-align: center; width: 60px;">
                                    {$order['price']}元
                                </div>
                            </td>
                                <td align="center">
                                    <div style="text-align: center; width: 150px;">
                                        {$order['deliver_time']}
                                    </div>
                                </td>
                                <td align="left">
                                    <div style="text-align: left; width: 100px;">
                                        <a class="btn blue" href="{:U('Order/invoice', array('id'=>$order['id']))}" ><i class="fa fa-search"></i>查看发货单</a>
                                    </div>
                                </td>
                                <td align="" class="" style="width: 100%;">
                                    <div>&nbsp;</div>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                </div>
                <!--分页位置-->
                {$page}
            </div>
        </form>
    </bDi>
</div>
<script type="text/javascript" src="__PUBLIC__/usr/js/layer/laydate/laydate.js"></script>
<script type="text/javascript">
    $(function() {
        //日历插件
        $('#start_time').layDate();
        $('#end_time').layDate();
        $("#shop_name").change(function(){
            $aName = $(this).val();
            if($aName != ''){
                getAgentName();
            }else{
                return false;
            }
        });
    });
    function getAgentName()
    {
        $.ajax({
            url: "{:U('Order/searchShopName')}",
            type: "post",
            data: {aName : $aName},
            success: function (data)
            {
                var options = '<option value="">请选择店铺名</option>';
                if (data) {
                    $.each(data, function(k, v){
                        options += '<option value="'+ v.id +'">'+ v.shop_name +'  '+v.company+'</option>';
                    });
                }
                $("#shop_id").html(options);
            }
        });
    }
</script>
